<template>
	<div class="detail_slide pl-4 pr-4">
		<div class="detail_slide_main">
			<!-- <van-field v-if="detail.startDistance > 0" class="radius-sm" label="距离会议开始" :border="false">
				<template #input>
					<van-count-down :time="detail.startDistance" format="DD 天 HH 时 mm 分 ss 秒" />
				</template>
			</van-field> -->
			<base-collapse class="mt-3" title="会议详情" v-model="activeNames" name="meetingInfo">
				<template #value>
					<div :class="{ 9: 'text-success', 13: 'text-danger' }[detail.approveStatus]">
						<span style="padding-left: 5px;">{{ detail.approveStatusDesc }}</span>
					</div>
				</template>
				<div class="pb-4">
					<DetailMeeting :detail="detail"/>
				</div>
			</base-collapse>
			<base-collapse class="mt-4" title="会议资料上传" v-model="activeNames" name="hexiao" >
				<UploadFile :detail="detail" />
			</base-collapse>
		</div>
	</div>
</template>

<script setup>
import UploadFile from "./components/upload-file.vue"
import DetailMeeting from "./components/detail.vue"
import { inject, ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'

const api = inject('api')
const route = useRoute()
const activeNames = ref(['meetingInfo'])
const detail = ref({})

const getDetail = async () => {
	const res = await api.meetingDetail(route.params.id)
	if (!res.code) {
		detail.value = res.data
	}
}

onMounted(() => {
	getDetail()
})
</script>
